package HashMapExample;
import java.util.Map;
import java.util.HashMap;

public class HashMapDemo {
    public static void main(String[] args) {
        Map<String,String> ha = new HashMap<String,String>();
        ha.put("2","two");
        ha.put("1","one");
        ha.put("3","three");
        System.out.println("获取健对应的值");
        System.out.println(ha.get("1"));
        System.out.println(ha.get("2"));
        System.out.println("获取所有的键");
        System.out.println(ha.keySet());
        System.out.println("获取所有的值");
        System.out.println(ha.values());
        System.out.println("获取所有的键和值");
        System.out.println(ha.entrySet());
    }
}